var MapLayerManager = YYC.Class(LayerManager,{
    Init:function (layer) {
        this.base(layer)
    },
    Private:{
        __getMapImg: function (i, j, mapData) {
            var img = null

            switch (mapData[i][j]) {
            case 1:
                img = window.imgLoader.get('ground')
                break
            case 2:
                img = window.imgLoader.get('wall')
                break
            default:
                break
            }

            return img
        }
    },
    Public:{
        createElement:function () {
            var i = 0,
                j = 0,
                map = bomberConfig.map,
                element = [],
                mapData = mapDataOperate.getMapData(),
                img = null

            // img = window.imgLoader.get('ground')
            for (i = 0; i < map.ROW; i++) {
                //注意！
                //y为纵向height，x为横向width
                y = i * bomberConfig.HEIGHT

                for (j = 0; j < map.COL; j++) {
                    x = j * bomberConfig.WIDTH
                    img = this.__getMapImg(i, j, mapData)
                    element.push(bitmapFactory.createBitmap({
                        img: img,
                        width: bomberConfig.WIDTH,
                        height: bomberConfig.HEIGHT,
                        x: x,
                        y: y
                    }))
                }
            }

            return element
        }
    }
})